package com.xie.service;

import com.xie.dao.HomeworkMapper;
import com.xie.pojo.Homework;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HomeworkServiceImpl implements HomeworkService {

    private HomeworkMapper homeworkMapper;
    public void setHomeworkMapper(HomeworkMapper homeworkMapper) {
        this.homeworkMapper = homeworkMapper;
    }

    public int addHomework(Homework homework) {
        return homeworkMapper.addHomework(homework);
    }

    public List<Homework> queryAllHomework() {
        return homeworkMapper.queryAllHomework();
    }

    public int deleteHomework(int homework_id) {
        return homeworkMapper.deleteHomework(homework_id);
    }

    public int updateHomework(Homework homework) {
        return homeworkMapper.updateHomework(homework);
    }

    public Homework queryHomework(int homework_id) {
        return homeworkMapper.queryHomework(homework_id);
    }

    public List<Homework> queryHomeworkByName(String sname) {
        return homeworkMapper.queryHomeworkByName(sname);
    }
}
